const router = require('express').Router()
const { FormAdd, GetFormByUserId, GetFormByProjectId } = require('../../handler/forms')

router.post('/apply', (req, res) => {
  FormAdd(req.body).then(result => res.send(result)).catch(err => res.send(error('服务异常')))
})

router.get('/getMyProject', (req, res) => {
  GetFormByUserId(req.query).then(result => res.send(result)).catch(err => res.send(error('服务异常')))
})

router.get('/getPeopleDetail', (req, res) => {
  GetFormByProjectId(req.query).then(result => res.send(result)).catch(err => res.send(error('服务异常')))
})

module.exports = router